const defender = async (ctx, next) => {
    if (ctx.session.user) {
        await next();
    } else {
        ctx.redirect("/login");
    }
};

module.exports = defender;
